package com.example.controller;

import com.example.domain.po.LycheeVariety;
import com.example.domain.response.HttpResponse;
import com.example.service.LycheeVarietyService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/lycheeVarity")
@RequiredArgsConstructor
public class LycheeVarityController {

    private final LycheeVarietyService lycheeVarietyService;

    @GetMapping("/list")
    public HttpResponse<List<LycheeVariety>> getLychee(){
        return HttpResponse.success(lycheeVarietyService.listLychee());
    }
}
